<template>
  <div class="app">
    <TopNav></TopNav>
    <div class="swiper-div">
      <swiper class="swiper" :options="swiperOption">
        <swiper-slide class="swiper-slide" v-for='item of swiperList' :key='item.id'>
          <img class="swiper-img" :src='item.imgUrl' />
        </swiper-slide>
        <div class="swiper-pagination"  slot="pagination"></div>
      </swiper>
      <div class="songs-div">
        <div class="cells-div">
          <div class="cell-text" v-for="(item, index) of sons" :key="index">{{item}}</div>
        </div>
      </div>
    </div>
    <div class="footer-div">教务处<br>电话：129039039</div>
  </div>
</template>

<script>
  import TopNav from '@/components/top-nav'
  export default {
    name: 'home',
    components: {
      TopNav
    },
    data() {
      return {
        msg: 'msg',
        sons: ['快过来', '我一个人包围了五个', '我是谁啊', '我在那'],
        swiperOption: {
          pagination: '.swiper-pagination',
          loop: true,
          autoplay: true
        },
        swiperList: [{
          "id": "0001",
          "imgUrl": "static/imags/1.jpg"
        },{
          "id": "0002",
          "imgUrl": "static/imags/2.jpg"
        },{
          "id": "0003",
          "imgUrl": "static/imags/1.jpg"
        },{
          "id": "0004",
          "imgUrl": "static/imags/2.jpg"
        }]
      }
    },
    methods: {
      testFunc: function () {
        console.log('testFunc')
      }
    },
    created() {
      document.title = "template"
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped type="text/stylus" lang="stylus">
.app {
  .swiper-div{
    position: relative
    height: 100%
    background: green
    .swiper {
      .swiper-img {
        width: 100%
        height: 800px
      }
    }
    .songs-div {
      position: absolute
      width: 100%
      right: 30px
      left: 0
      top: 0
      bottom: 0
      z-index: 2
      display: flex
      .cells-div{
        margin: auto 0
        width: 100%
        .cell-text {
          padding: 15px 30px 15px 0
          color: white
          text-align: right
          width: 100%
          font-size: 18px
        }
      }
    }
  }
  .footer-div {
    text-align: center
    position: fixed
    color: white
    font-size: 18px
    bottom: 0
    left: 0
    right: 0
    z-index: 2
  }
}
</style>
